/**
 * Copyright (C), 2001-2031, www.bosssof.com.cn
 * FileName: MessageController.java
 * Author: shixianwei
 * Date: 2024/8/8 16:49
 * Description:
 * <p>
 * History:
 * Date          Author   Version  Desc
 * 2024-01-01    bosssoft  1.0.0   initialize this file
 */
package com.bosssoft.setp.controller;

import com.bosssoft.setp.pojo.dto.LoginDTO;
import com.bosssoft.setp.pojo.vo.LoginVO;
import com.bosssoft.setp.pojo.vo.Result;
import com.bosssoft.setp.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @className: MessageController
 * @description:
 * 与登录模块的接口
 * @author: shixianwei
 * @date: 2024/8/8 16:49
 * @since 1.0
 **/
@CrossOrigin
@RequestMapping("/login")
@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;




    /**
     * 实现账号密码登录
     * @param
     * @return
     */
    @PostMapping(value = "/id-password")
    public Result<LoginVO> logWithIdAndPassword(@NotNull @Valid @RequestBody LoginDTO loginDTO) {
            return Result.success(loginService.logWithIdAndPassword(loginDTO));
    }

}

